
# Corrupting the Battlefield
Read Me File For Corrupting the Battlefield containing information on all scripts and files for the replication of the manuscript

Analysis conducted in R version 4.0.5 (2021-03-31) -- "Shake and Throw" in macOS 13.6.7
Note: Replication Check conducted in R version 4.4.5 (2024-06-14) -- "Race for Your Life" in macOS 14.5. Replication shows that main analysis replicates in existing version of data, but re-conducting imputation leads to small differences in coefficients, results are stable. Bayesian Analysis and subsequent LOO analysis also has small differences in coefficients and ELPD, again results are stable. In addition, new versions of R may struggle with the following packages: "bcROCsurface", "interplot.medline"

Scripts
1) Replication_Corruption.Rproj
   - R Project file. Required in the origin of path for the relative paths in "here" package to work.
   - Opening this file should open all relevant R scripts in Rstudio.
2) CB_Data_Cleaning.R
   - R script to clean and merge Cochran and Long 2017 Replication Data and Variables from VDem and conduct multiple impute.
3) CB_Rep.R
   - R script to conduct main analysis (figures and tables in the main body of the text except for Bayesian components).
   - Creates Figure 1 and Table 1 in Main Text
4) CB_Bayesian_Rep.R   
   - R script to conduct all Bayesian analysis in the Main Text and Appendix.
   - Creates Table 2 in Main Text and Model Comparison section in Appendix.
   - This Analysis Requires that Stan be installed in the system for detailed instructions in using Stan and Rstan please see https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started
5) CB_App.R
   - R script to recreate tables and figures in the Appendix (except analysis of Grauer and Horowitz (2012) Data Analysis and the Bayesian analysis in the Model Comparison section).
6) CB_App_GH2012.R
   - R script to recreate tables and figures in the Grauer and Horowitz (2012) Data Analysis Appendix section.
7) simple_linear.stan
   - Stan file which codes the Bayesian linear model used in the CB_Bayesian_Rep.R file to run Bayesian linear models for model comparison.
8) simple_logit.stan
   - Stan file which codes the Bayesian logit model used in the CB_Bayesian_Rep.R file to run Bayesian logit models for model comparison.

Data Sets
1) CochranLong2017ReplicationData
   - Folder containing replication data from Cochran and Long (2017)
   - ReiterStamISReplicationAugust2016.dta : main dataset used in replication which we use for our main dependent variables and other controls used in CB_Data_Cleaning.R
2) Vdem   
   - Folder containing Vdem (version 12) data used for main independent variable and other controls
   - V-Dem-CY-Full+Others-v12.csv : Vdem data used in CB_Data_Cleaning.R
3) replication_data_afs.csv
   - Clean Imputed Data set for analysis. Used in CB_Rep.R,  CB_Bayesian_Rep.R, and CB_App.R
4) replication_data_missingobs_afs.csv
   - Clean Data set with no imputation for analysis. Used in CB_App.R
5) GH_SS_Replication.Data
   - Replication Data for Grauer and Horowitz (2012) used in Grauer and Horowitz (2012) Data Analysis Appendix Section
6) GEDEvent_v23_1.csv
   - UCDP Georeferenced Events data (version 23_1) used in CB_Rep.R to calculate battle deaths for Chechnya Conflict Case Study
